package net.vkits.api;

import io.swagger.annotations.*;
import net.vkits.common.dto.BaseDTO;
import net.vkits.common.dto.Contract;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

@javax.annotation.Generated(value = "class io.swagger.codegen.languages.SpringCodegen", date = "2016-10-27T05:49:23.577Z")

@Api(value = "contract", description = "the contract API")
@RequestMapping("/api/v2")
public interface ContractApi {

    @ApiOperation(value = "add contract", notes = "add contract", response = BaseDTO.class, tags={ "contract", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "OK", response = BaseDTO.class),
        @ApiResponse(code = 400, message = "something wrong", response = BaseDTO.class) })
    @RequestMapping(value = "/contract",
        produces = { "application/json" },
        method = RequestMethod.PUT)
    ResponseEntity<BaseDTO> addContract(
            @ApiParam(value = "合同基本信息", required = true) @RequestBody Contract contract
    );

    @ApiOperation(value = "Get contract info", notes = "This can only be done by the logged in user.", response = Contract.class, tags={ "contract", })
    @ApiResponses(value = { 
        @ApiResponse(code = 200, message = "return User info", response = Contract.class),
        @ApiResponse(code = 404, message = "User not found", response = Contract.class) })
    @RequestMapping(value = "/contract",
        produces = { "application/json" }, 
        method = RequestMethod.GET)
    ResponseEntity<Contract> getContract();

    @ApiOperation(value = "add photo", notes = "add photo", response = String.class, tags={ "contract", })
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "OK", response = String.class),
            @ApiResponse(code = 400, message = "something wrong", response = String.class) })
    @RequestMapping(value = "/contract/photo",
            produces = { "multipart/form-data" },
            method = RequestMethod.PUT)
    ResponseEntity<String> addPhoto(
            @ApiParam(value = "file detail") @RequestPart("file") MultipartFile file,
            @ApiParam(value = "add photo number", required = true) @RequestPart(value = "number", required = true) String number
    );
}
